package com.haighcom.controller;

import com.haighcom.model.User;
import com.haighcom.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;
    //获取当前登录用户的用户名
    @RequestMapping("/getUsername")
    public User getUsername() throws Exception {
        return userService.findByUserName("admin");
    }
}

